class Person:
    def __init__(self, name, age):
        self.name = name  # 初始化姓名属性
        self.age = age    # 初始化年龄属性

    # 方法：打招呼
    def greet(self):
        print(f"Hello, my name is {self.name} and I am {self.age} years old.")

    # 方法：设置新的年龄
    def set_age(self, new_age):
        self.age = new_age

    # 方法：获取当前年龄
    def get_age(self):
        return self.age

